package com.liuyjy.base.except.exception;


import com.liuyjy.base.common.result.ResultCodeInterface;

import java.io.Serializable;

/**
 * 远程过程调用异常
 */

public class RemoteRpcException extends BaseException implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = 1412104290896291411L;

    /**
     * 通用
     *
     * @param enumService code
     */
    public RemoteRpcException(ResultCodeInterface enumService, String message) {
        super(enumService.getCode(), enumService.getMsg() + ":" + message);
    }

    public RemoteRpcException(ResultCodeInterface enumService) {
        super(enumService.getCode(), enumService.getMsg());
    }

    public RemoteRpcException(String msg) {
        super("500", msg);
    }

    public RemoteRpcException(Exception e) {
        this(e.getMessage());
    }

    public RemoteRpcException(String msg, Throwable e) {
        super(msg, e);
    }

    public RemoteRpcException(String code, String message) {
        super(code, message);
    }

    public RemoteRpcException(String code, String message, Throwable e) {
        super(code, message, e);
    }

}
